package top.codechap.ioc.service.impl;

import top.codechap.ioc.dao.UserDao;
import top.codechap.ioc.service.UserService;

/**
 * 业务逻辑层实现类
 */
public class UserServiceImpl implements UserService {

    //声明一个UserDao类型的变量
    private UserDao userDao;

    public UserServiceImpl() {
        System.out.println("创建了UserServiceImpl对象...");
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void add() {
        System.out.println("UserService...");
        userDao.add();
    }
}
